layui.use(['layer', 'form'], function(){
  var layer = layui.layer
  ,form = layui.form;
});

var html = '<a class="layui-btn layui-btn-warm layui-btn-xs sharp-goods" lay-event="attr"><i class="fa fa-cube">添加商品</i></a>';
$('td.column-__actions__').prepend(html);

$('.sharp-goods').on('click', function () {
    // 找到这一列的id
    var id = $(this).siblings('.grid-row-delete').attr('data-id');

    layer.confirm('', {
      btn: ['有属性规格', '无属性规格'] //可以无限个按钮
    }, function(index, layero){
      (document).location = '/sharp-goods-sku/'+ id +'/edit';
    }, function(index){
      (document).location = '/sharp-goods/'+ id +'/edit';
    });
});